package app.netant.galgame.yuinya;

import cn.lily.com.file.excel.io.ExcelWriter;

public class YuiNyaAntPage {
	
	private ExcelWriter ew;
	private String pageHref = "http://yui-nya.com/category/games/cn/page/";
	private String homeHref = "http://yui-nya.com/category/games/cn";
	
	private int startPage = 1;
	private int endPage = 58;
	
	public void analyse(){
		
		int index = 0;
		
		this.ew = new ExcelWriter("D:/mm.xlsx");
		this.ew.inst();
		this.ew.locateSheet(0);
		
		for(int i=startPage;i<=endPage;i++){
			
			String url = "";
			if(i==1){
				url = homeHref;
			}else{
				url = pageHref+i;
			}

			System.out.println("开始处理地址："+url);
			YuiNyaNetAntDetail ant = new YuiNyaNetAntDetail(url);
			System.out.println("连接地址成功："+url);
			
			index = ant.analyse(ew,index);

		}
		
		ew.write();
		ew.free();
		
	}
	
	public static void main(String[] args) {
		YuiNyaAntPage page = new YuiNyaAntPage();
		page.analyse();
	}
	
}
